﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/Shared/_LayoutShow.cshtml";
   DTcms.Model.sites site = ViewData["site"] as DTcms.Model.sites;
   DTcms.Model.sysconfig config = ViewData["sysConfig"] as DTcms.Model.sysconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   ViewBag.Title = "会员管理 - " + site.name;
   string action = ViewBag.Action as string;
}

<!--当前位置-->
<div class="section">
  <div class="location">
    <span>当前位置：</span>
    <a href="@bc.linkurl("index")">首页</a> &gt;
        <a href="javascript:;">取回密码</a>
  </div>
</div>
<!--/当前位置-->

<!--导航推荐-->
<div class="section">
  <div class="wrapper">
    <div class="bg-wrap">
      <div class="nav-tit">
        <a class="selected" href="javascript:;">取回密码</a>
        <i>|</i>
        <a href="@bc.linkurl("login")">账户登录</a>
      </div>

      <!--取回密码-->
      @if (action == "") {
        <script type="text/javascript">
          $(function () {
            //初始化表单
            AjaxInitForm('#pwdForm', '#btnSubmit', 1);
          });
        </script>
        <form id="pwdForm" name="pwdForm" url="@(config.webpath)tools/submit_ajax.ashx?action=user_getpassword&site_id=@site.id">
          <div class="form-box full">
            <dl class="form-group">
              <dt>取回方式：</dt>
              <dd>
                <label class="mart">
                  <input name="txtType" type="radio" value="mobile" checked="checked" />
                  手机短信</label>
                <label class="mart">
                  <input name="txtType" type="radio" value="email" datatype="*" sucmsg=" " />
                  电子邮箱</label>
              </dd>
            </dl>
            <dl class="form-group">
              <dt>用 户 名：</dt>
              <dd>
                <input id="txtUserName" name="txtUserName" type="text" class="input" datatype="*1-50" sucmsg=" " />
              </dd>
            </dl>
            <dl class="form-group">
              <dt>验 证 码：</dt>
              <dd>
                <input id="txtCode" name="txtCode" type="text" class="input code" placeholder="输入验证码" datatype="s4-20" nullmsg="请输入右边显示的验证码" sucmsg=" " />
                <a class="send" href="javascript:;" onclick="ToggleCode(this, '@(config.webpath)tools/verify_code.ashx');return false;">
                  <img src="@(config.webpath)tools/verify_code.ashx" width="80" height="22" />
                </a>
              </dd>
            </dl>
            <dl class="form-group">
              <dd>
                <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit" />
              </dd>
            </dl>
          </div>
        </form>
        <!--取回密码-->
            
        <!--手机取回密码-->
      }
      else if (action == "mobile") {
        <script type="text/javascript">
          $(function () {
            //初始化表单
            AjaxInitForm('#pwdForm', '#btnSubmit', 1, '#turl');
          });
        </script>
        <form id="pwdForm" name="pwdForm" url="@(config.webpath)tools/submit_ajax.ashx?action=user_repassword&site_id=@site.id">
          <div class="form-box full">
            <dl class="form-group">
              <dt>短信验证码：</dt>
              <dd>
                <input name="hideCode" id="txtTelphone" type="text" class="input" datatype="*" />
                <span class="Validform_checktip">输入您手机收到的验证码</span>
              </dd>
            </dl>
            <dl class="form-group">
              <dt>新 密 码：</dt>
              <dd>
                <input name="txtPassword" id="txtPassword" type="password" class="input" datatype="*6-20" nullmsg="请输入新密码" errormsg="密码范围在6-20位之间" sucmsg=" " />
                <span class="Validform_checktip">重新设置新的密码</span>
              </dd>
            </dl>
            <dl class="form-group">
              <dt>确认新密码：</dt>
              <dd>
                <input name="txtPassword1" id="txtPassword1" type="password" class="input" datatype="*" recheck="txtPassword" nullmsg="请再输入一次新密码" errormsg="两次输入的密码不一致" sucmsg=" " />
                <span class="Validform_checktip">再次输入新的密码</span>
              </dd>
            </dl>
            <dl class="form-group">
              <dd>
                <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit" />
              </dd>
            </dl>
          </div>
        </form>
        <input id="turl" type="hidden" value="@bc.linkurl("login")" />
        <!--/手机取回密码-->
            
        <!--邮箱取回密码-->
      }
      else if (action == "email") {
        <script type="text/javascript">
          $(function () {
            //初始化表单
            AjaxInitForm('#pwdForm', '#btnSubmit', 1, '#turl');
          });
        </script>
        <form id="pwdForm" name="pwdForm" url="@(config.webpath)tools/submit_ajax.ashx?action=user_repassword&site_id=@site.id">
          <div class="form-box full">
            <dl class="form-group">
              <dt>用户名：</dt>
              <dd>
                @ViewBag.UserName
                <input name="hideCode" type="hidden" value="@ViewBag.Code" />
              </dd>
            </dl>
            <dl class="form-group">
              <dt>新密码：</dt>
              <dd>
                <input name="txtPassword" id="txtPassword" type="password" class="input" datatype="*6-20" nullmsg="请输入新密码" errormsg="密码范围在6-20位之间" sucmsg=" " />
                <span class="Validform_checktip">重新设置新的密码</span>
              </dd>
            </dl>
            <dl class="form-group">
              <dt>确认新密码：</dt>
              <dd>
                <input name="txtPassword1" id="txtPassword1" type="password" class="input" datatype="*" recheck="txtPassword" nullmsg="请再输入一次新密码" errormsg="两次输入的密码不一致" sucmsg=" " />
                <span class="Validform_checktip">再次输入新的密码</span>
              </dd>
            </dl>
            <dl class="form-group">
              <dd>
                <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="submit" />
              </dd>
            </dl>
          </div>
        </form>
        <input id="turl" type="hidden" value="@bc.linkurl("login")" />
        <!--/邮箱取回密码-->
            
        <!--错误界面-->
      }
      else if (action == "error") {
        <div class="msg-tips">
          <div class="icon error">
            <i class="iconfont icon-error"></i>
          </div>
          <div class="info">
            <strong>出错了，该用户不存在或验证已过期！</strong>
            <p>无法验证你的账户，不知神马原因，可能是你的用户名不存在或者验证码已经过期！</p>
            <p>不过别担心，如果您还记得你的会员名称的话，点击这里<a href="@bc.linkurl("login")">进入会员中心</a>吧。</p>
          </div>
        </div>
      }
      <!--/错误界面-->
    </div>
  </div>
</div>
